﻿using Newtonsoft.Json;

namespace AutomationCommand
{
    public class ml_shell_option : BasiCommand
    {
        [JsonProperty("overtime")]
        public int Overtime { get; set; }

        [JsonProperty("m")]
        public MOption M { get; set; }

        public ml_shell_option()
        {
            FunctionType = "ml_shell_option";
            OtherName = "手机直接操作";
            Overtime = 10000;
            M = new MOption
            {
                T = "Automator",
                C = "",
                A = "",
                See = new MOption.SeeOption
                {
                    T = "Automator",
                    C = "",
                    E = 1
                },
                Times = new MOption.TimesOption
                {
                    T = 10000,
                    C = 100
                }
            };
            SuccessJump = -1;
            FailureJump = -1;
        }

        public bool Execute()
        {
            // 在这里编写执行命令的逻辑
            // 返回执行结果
            return true; // 假设此处始终成功
        }

        public class MOption
        {
            [JsonProperty("t")]
            public string T { get; set; }

            [JsonProperty("c")]
            public string C { get; set; }

            [JsonProperty("a")]
            public string A { get; set; }

            [JsonProperty("see")]
            public SeeOption See { get; set; }

            [JsonProperty("times")]
            public TimesOption Times { get; set; }

            public class SeeOption
            {
                [JsonProperty("t")]
                public string T { get; set; }

                [JsonProperty("c")]
                public string C { get; set; }

                [JsonProperty("e")]
                public int E { get; set; }
            }

            public class TimesOption
            {
                [JsonProperty("t")]
                public int T { get; set; }

                [JsonProperty("c")]
                public int C { get; set; }
            }
        }
    }
}
